<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/jquery.js"></script>
</head>
<body>
<input type="button" id="btn01" value="ajax测试"/>
<script>
    $("#btn01").on("click",function() {
        console.log("Begin:")
        list={"username":"zhangsan"}
        $.ajax({
            type:"POST",
            contentType: "application/json;charset=UTF-8",
            url:"http://localhost:8011/getAllProducts",
            data : JSON.stringify(list),
            success:function(result){
                console.log('test');
                console.log(result);
            },
            error:function(err){

            }
        })

    })

</script>

</body>
</html>